// 获取东八区时间
var curentTime = function (time) {
    var d = time ? new Date(time) : new Date();
    var localTime = d.getTime();
    var localOffset = d.getTimezoneOffset() * 60000; //获得当地时间偏移的毫秒数
    var utc = localTime + localOffset + 3600000 * 8;
    var now = new Date(utc);

    var year = now.getFullYear(); //年
    var month = now.getMonth() + 1; //月
    var day = now.getDate(); //日
    var hh = now.getHours(); //时
    var mm = now.getMinutes(); //分
    var ss = now.getSeconds(); //秒

    var clock = year + "-";

    if (month < 10)
        clock += "0";

    clock += month + "-";

    if (day < 10)
        clock += "0";

    clock += day + " ";

    if (hh < 10)
        clock += "0";

    clock += hh + ":";

    if (mm < 10)
        clock += "0";

    clock += mm + ":";

    if (ss < 10)
        clock += "0";

    clock += ss;

    return (clock);
}

module.exports = {
  curentTime
}